<!--[ include file="admin_header_menu.htm" ]-->
<div class="admin_content">
<script language="javascript" src="modules/iCarrent/pnajax/ajax_model.js"></script>
<a class="button" href="#">เพิ่ม / แก้ไข รุ่น</a>
<form id='form' class='form' action="<!--[pnmodurl modname='iCarrent' type='adminform' func='submit' ctrl='Model']-->" method="post">
<input type="hidden" name="form[id]" value="<!--[$_GET.id]-->" />
<input type="hidden" id='icon2d_field' name="form[icon]" value="<!--[$form.icon]-->" />
<table class="adminform">
  <tr>
    <td><!--[pnml name='_ICARRENT_ADMIN_FORM_BRAND_NAME']--> : </td>
    <td>
      <table>
        <tr>
          <td>
            <span id="brand">
                <!--[if $form.brand_id == "99999"]-->
                  <select name="form[brand_id]" id="form_brand_id_" 
                          style="width: 165px; height: 150px; background: none repeat scroll 0% 0% rgb(220, 220, 220);" 
                          size="8"
                  >
                    <option value="99999" selected></option>
                    <option value="99999"></option>
                    <option value="99999"></option>
                    <option value="99999">Empty category</option>
                    <option value="99999">Please select new </option>
                  </select>
                <!--[else]-->
                  <!--[selector_object_array_ex modname="iCarrent" 
                          class="Brand" 
                          field="id" 
                          displayField="name"  
                          name="form[brand_id]" 
                          selectedValue=$form.brand_id 
                          size="8"
                          sort="bra_name"
                  ]-->
                <!--[/if]-->
            </span>
          </td>
        </tr>
      </table>
    </td>
  </tr>
    <tr>
    <td><!--[pnml name='_ICARRENT_ADMIN_FORM_MODEL_NAME']--> : </td>
    <td><input type="text" name="form[name]" value="<!--[$form.name]-->" title="Please enter category name" class="required"  /></td>
  </tr>
  <tr>
    <td><!--[pnml name='_ICARRENT_ADMIN_FORM_SUB_CATEGORY_SUBCATEGORY']-->  </td>
    <td>
      <!--[get_all_category]-->
      <table class="brand">
        <!--[foreach from=$categoryArray item=itemCategory]-->
          <tr>
            <th class="head_brand" colspan="3"><!--[$itemCategory.category_name]--></th>
          </tr>
            <!--[get_subcategory_by_category_id category_id=$itemCategory.category_id]-->
            <!--[foreach from=$subcategoryArray item=itemSubcategory name=foo]-->
                <!--[assign var='compare' value='false']-->
                <!--[foreach from=$extendResult.subcategory_model item=sb]-->

                 <!--[if $itemSubcategory.subcategory_id eq $sb.subcategory_id]-->
                    <!--[assign var='compare' value='true']-->
                  <!--[/if]-->
                <!--[/foreach]-->
                <!--[if $compare eq 'false']-->
                  <!--[if $smarty.foreach.foo.index%3 == 0]-->
                    <tr>
                      <td><INPUT TYPE="checkbox" NAME="sb[<!--[$itemSubcategory.subcategory_id]-->]" value="<!--[$itemCategory.category_id]-->">&nbsp;<!--[$itemSubcategory.subcategory_name]--></td>
                  <!--[elseif $smarty.foreach.foo.index%3 == 1]-->
                      <td><INPUT TYPE="checkbox" NAME="sb[<!--[$itemSubcategory.subcategory_id]-->]" value="<!--[$itemCategory.category_id]-->">&nbsp;<!--[$itemSubcategory.subcategory_name]--></td>
                  <!--[elseif $smarty.foreach.foo.index%3 == 2]-->
                      <td><INPUT TYPE="checkbox" NAME="sb[<!--[$itemSubcategory.subcategory_id]-->]" value="<!--[$itemCategory.category_id]-->">&nbsp;<!--[$itemSubcategory.subcategory_name]--></td>
                    </tr>
                  <!--[/if]-->
                <!--[elseif  $compare eq 'true']-->
                  <!--[if $smarty.foreach.foo.index%3 == 0]-->
                    <tr>
                      <td>
                        <INPUT TYPE="checkbox" NAME="sb[<!--[$itemSubcategory.subcategory_id]-->]" value="<!--[$itemCategory.category_id]-->" checked>&nbsp;<!--[$itemSubcategory.subcategory_name]-->
                      </td>
                  <!--[elseif $smarty.foreach.foo.index%3 == 1]-->
                      <td>
                        <INPUT TYPE="checkbox" NAME="sb[<!--[$itemSubcategory.subcategory_id]-->]" value="<!--[$itemCategory.category_id]-->" checked>&nbsp;<!--[$itemSubcategory.subcategory_name]-->
                      </td>
                  <!--[elseif $smarty.foreach.foo.index%3 == 2]-->
                      <td>
                        <INPUT TYPE="checkbox" NAME="sb[<!--[$itemSubcategory.subcategory_id]-->]" value="<!--[$itemCategory.category_id]-->" checked>&nbsp;<!--[$itemSubcategory.subcategory_name]-->
                      </td>
                    </tr>
                  <!--[/if]-->
                <!--[/if]-->
              <!--[/foreach]-->
        <!--[/foreach]-->
      </table>
    </td>
  </tr>
</table>
	<button name="button_submit" value='Submit' type="submit" class="button save">ตกลง</button>
	<button name="button_cancel" value='Cancel' type="submit" class="button flag">ยกเลิก</button>
</form>
</div>